#pragma once

#include <ddm/if/gen-cpp2/DdmCtrl.h>
#include <openr/common/OpenrEventBase.h>
#include <openr/decision/RouteUpdate.h>
#include <openr/if/gen-cpp2/OpenrCtrlCpp.h>
#include <openr/messaging/ReplicateQueue.h>

namespace ddm {
class CtrlHandler : public thrift::DdmCtrlSvIf {
 public:
  CtrlHandler(openr::messaging::ReplicateQueue<openr::DecisionRouteUpdate>&
                  routeUpdatesQueue,
              openr::OpenrEventBase* evb, std::string nodeId);

  folly::SemiFuture<folly::Unit> semifuture_insertRoute(
      std::unique_ptr<openr::thrift::UnicastRoute>) override;

  folly::SemiFuture<folly::Unit> semifuture_submitRequirement(
      std::unique_ptr<ddm::thrift::Requirement>) override;

 private:
  openr::messaging::ReplicateQueue<openr::DecisionRouteUpdate>&
      routeUpdatesQueue_;
  openr::OpenrEventBase* evb_{nullptr};
};

}  // namespace ddm